/*
 * files.h - Header file of directory, devices and files management
 */
#ifndef __FILES_H__
#define __FILES_H__

#include <sched.h>


//access modes of the files
#define O_RDONLY 0x1
#define O_WRONLY 0x2
#define O_RDWR 0x3
#define FILE_NAME_SIZE 10
#define NR_FILES 10
#define NR_DYN (NR_TASKS*NR_FD)  //@@@think about a better name

//structure for logical devices (static info)
struct file_stat_info
{
	char name[FILE_NAME_SIZE];
	int access_mode_allowed; //read only/read and write/write only
	//file_operations * file_op;   //pointer to a file of operations
	unsigned int first_block;  //first block of file in file system
	int num_refs; //the number of references to the files
};

struct file_stat_info directory[NR_FILES];  //the directory

//structure for logical devices (dynamic info)
struct file_dyn_info
{
	unsigned int offset; //current offset of the blocks file
	int mode; //current mode
	int num_refs; //the number of references to the files
};

//table for storing dynamic info about files
struct file_dyn_info file_access[NR_DYN];


void init_devices();

#endif  /* __FILES_H__ */
